package com.ethink.platform.controller.warehouse;

import com.ethink.warehouse.api.request.LogisticsTraceApplyOrderListRequest;
import com.ethink.warehouse.api.response.LogisticsTraceApplyOrderGetDetailResponse;
import com.ethink.warehouse.api.response.LogisticsTraceApplyOrderQueryResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import com.ethink.framework.common.web.BaseController;
import com.ethink.framework.common.web.response.CommonResponse;
import com.ethink.warehouse.api.LogisticsTraceApplyOrderFacade;
import com.ethink.warehouse.api.request.LogisticsTraceApplyOrderQueryRequest;

/**
 * 物流跟进申请表 Controller
 *
 * @author default
 * @date 2022-12-15
 */
@Tag(name = "LogisticsTraceApplyOrderController", description = "物流跟进申请表 Controller")
@RestController
@Slf4j
@RequestMapping("platform-server/v1/warehouse-service")
public class LogisticsTraceApplyOrderController extends BaseController {

    @Autowired
    private LogisticsTraceApplyOrderFacade logisticsTraceApplyOrderFacade;

    @Operation(summary = "分页查询")
    @GetMapping("/logisticsTraceApplyOrder/query")
    public CommonResponse<List<LogisticsTraceApplyOrderQueryResponse>> queryLogisticsTraceApplyOrder(LogisticsTraceApplyOrderQueryRequest request) {
        return succeedWithPage(logisticsTraceApplyOrderFacade.queryLogisticsTraceApplyOrder(request));
    }

    @Operation(summary = "查询所有")
    @GetMapping("/logisticsTraceApplyOrder/list")
    public CommonResponse<List<LogisticsTraceApplyOrderQueryResponse>> listLogisticsTraceApplyOrder(LogisticsTraceApplyOrderListRequest request) {
        return succeedWith(logisticsTraceApplyOrderFacade.listLogisticsTraceApplyOrder(request));
    }

    @Operation(summary = "详情查询")
    @GetMapping("/logisticsTraceApplyOrder/get/{logisticsTraceApplyOrderId}")
    public CommonResponse<LogisticsTraceApplyOrderGetDetailResponse> getLogisticsTraceApplyOrderById(@PathVariable("logisticsTraceApplyOrderId") Long logisticsTraceApplyOrderId) {
        return succeedWith(logisticsTraceApplyOrderFacade.getLogisticsTraceApplyOrderById(logisticsTraceApplyOrderId));
    }
}